package com.cityeye.util;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;

public class EncodingFilter extends HttpServlet implements Filter {  

    private static final long serialVersionUID = 8303042696511641966L;  
      
    @SuppressWarnings("unused")  
    private FilterConfig filterConfig;  
  
    public void doFilter(ServletRequest request, ServletResponse response,  
            FilterChain filterChain) throws IOException, ServletException {  
        request.setCharacterEncoding("GB2312");       
        filterChain.doFilter(request, response);      
    }  
  
    public void init(FilterConfig filterConfig) throws ServletException {  
        this.filterConfig = filterConfig;  
    }  
  
} 
